.class Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;
.super Ljava/lang/Object;
.source "RequestBalanceUpdateRunnable.java"

# interfaces
.implements Ljava/lang/Runnable;


# static fields
.field private static final LOG:Lcom/burstly/lib/util/LoggerExt;

.field private static final TAG:Ljava/lang/String;


# instance fields
.field private final mAccount:Lcom/burstly/lib/currency/UserAccount;

.field private final mListeners:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/burstly/lib/feature/currency/ICurrencyListener;",
            ">;"
        }
    .end annotation
.end field

.field private final mNewAccount:Lcom/burstly/lib/currency/AccountInfo;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 37
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 42
    const-class v0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->TAG:Ljava/lang/String;

    return-void
.end method

.method constructor <init>(Lcom/burstly/lib/currency/UserAccount;Lcom/burstly/lib/currency/AccountInfo;Ljava/util/List;)V
    .locals 0
    .parameter "account"
    .parameter "newAccount"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/burstly/lib/currency/UserAccount;",
            "Lcom/burstly/lib/currency/AccountInfo;",
            "Ljava/util/List",
            "<",
            "Lcom/burstly/lib/feature/currency/ICurrencyListener;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 67
    .local p3, listeners:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/feature/currency/ICurrencyListener;>;"
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 68
    iput-object p1, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mAccount:Lcom/burstly/lib/currency/UserAccount;

    .line 69
    iput-object p2, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mNewAccount:Lcom/burstly/lib/currency/AccountInfo;

    .line 70
    iput-object p3, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mListeners:Ljava/util/List;

    .line 71
    return-void
.end method


# virtual methods
.method public run()V
    .locals 10

    .prologue
    const/4 v9, 0x1

    const/4 v8, 0x0

    .line 75
    new-instance v1, Lcom/burstly/lib/currency/request/FindAccountRequest;

    invoke-direct {v1}, Lcom/burstly/lib/currency/request/FindAccountRequest;-><init>()V

    .line 76
    .local v1, requestData:Lcom/burstly/lib/currency/request/FindAccountRequest;
    iget-object v3, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mNewAccount:Lcom/burstly/lib/currency/AccountInfo;

    invoke-virtual {v3}, Lcom/burstly/lib/currency/AccountInfo;->getPubId()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Lcom/burstly/lib/currency/request/FindAccountRequest;->setPublisher(Ljava/lang/String;)V

    .line 77
    iget-object v3, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mNewAccount:Lcom/burstly/lib/currency/AccountInfo;

    invoke-virtual {v3}, Lcom/burstly/lib/currency/AccountInfo;->getUserId()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Lcom/burstly/lib/currency/request/FindAccountRequest;->setUserUid(Ljava/lang/String;)V

    .line 78
    sget-object v3, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v4, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->TAG:Ljava/lang/String;

    const-string v5, "Check actual balance for: {0}"

    new-array v6, v9, [Ljava/lang/Object;

    iget-object v7, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mNewAccount:Lcom/burstly/lib/currency/AccountInfo;

    aput-object v7, v6, v8

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 79
    new-instance v3, Lcom/burstly/lib/currency/secured/SecuredRequestBuilder;

    invoke-direct {v3}, Lcom/burstly/lib/currency/secured/SecuredRequestBuilder;-><init>()V

    invoke-virtual {v3, v1}, Lcom/burstly/lib/currency/secured/SecuredRequestBuilder;->setData(Ljava/lang/Object;)Lcom/burstly/lib/currency/secured/SecuredRequestBuilder;

    move-result-object v3

    invoke-virtual {v3}, Lcom/burstly/lib/currency/secured/SecuredRequestBuilder;->buildFindAccountRequest()Lcom/burstly/lib/currency/secured/SecuredServiceRequest;

    move-result-object v2

    .line 80
    .local v2, toPOst:Lcom/burstly/lib/currency/secured/SecuredServiceRequest;
    sget-object v3, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v4, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->TAG:Ljava/lang/String;

    const-string v5, "FindAccountRequest object is : {0}"

    new-array v6, v9, [Ljava/lang/Object;

    aput-object v1, v6, v8

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 81
    new-instance v0, Lcom/burstly/lib/network/request/CurrencyRequestTask;

    const-class v3, Lcom/burstly/lib/currency/request/AccountInfoResponse;

    invoke-direct {v0, v2, v3}, Lcom/burstly/lib/network/request/CurrencyRequestTask;-><init>(Ljava/lang/Object;Ljava/lang/Class;)V

    .line 83
    .local v0, currencyRequestTask:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<Lcom/burstly/lib/currency/request/AccountInfoResponse;>;"
    new-instance v3, Lcom/burstly/lib/currency/request/UpdateCurrencyCallback;

    iget-object v4, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mListeners:Ljava/util/List;

    iget-object v5, p0, Lcom/burstly/lib/currency/request/RequestBalanceUpdateRunnable;->mAccount:Lcom/burstly/lib/currency/UserAccount;

    invoke-direct {v3, v4, v5}, Lcom/burstly/lib/currency/request/UpdateCurrencyCallback;-><init>(Ljava/util/List;Lcom/burstly/lib/currency/UserAccount;)V

    invoke-virtual {v0, v3}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setCallback(Lcom/burstly/lib/network/request/IRequestCallback;)V

    .line 84
    new-array v3, v8, [Ljava/lang/Void;

    invoke-virtual {v0, v3}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 85
    return-void
.end method
